﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ECGWeb.Controls
{
    public partial class UnusualSignalList : System.Web.UI.UserControl
    {
        public ECGService.UnusualSignal[] unusualSignalArray = null;

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            unusual_gridview.PageIndexChanging += unusual_gridview_PageIndexChanging;
        }

        protected void unusual_gridview_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            unusual_gridview.PageIndex = e.NewPageIndex;
            unusual_gridview.DataBind();
            unusualSignalTblUpdatePanel.Update();
        }

        public void setDataSource(ECGService.UnusualSignal[] unusuals)
        {
            this.unusualSignalArray = unusuals;
            unusual_gridview.DataSource = unusuals;
            unusual_gridview.DataBind();
            if (unusuals == null)
            {
                notifyUL.Text = "Không có tín hiệu bất thường";
            }
            else
            {
                notifyUL.Text = "";
            }
        }        
    }
}